support loongarch elu erf gelu selu#6606
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6606 +/- ##
==========================================
- Coverage 93.41% 93.22% -0.19%
==========================================
Files 868 784 -84
Lines 275540 261017 -14523
==========================================
- Hits 257391 243346 -14045
+ Misses 18149 17671 -478 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds LoongArch-optimized implementations for several activation/math layers (SELU, GELU, ELU, Erf) and extends the LoongArch LSX/LASX math helper headers with new vector routines needed by those layers.
Changes:
- Add LoongArch layer implementations for SELU, GELU, ELU, and Erf with LSX/LASX vectorized fast paths plus scalar fallbacks.
- Extend
lsx_mathfun.hwitherf_psandelu_ps, and extendlasx_mathfun.hwithelu_psfor LASX. - Enable packing support in the new LoongArch layer constructors when LSX is available.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/layer/loongarch/selu_loongarch.h | Declares SELU_loongarch layer specialization. |
| src/layer/loongarch/selu_loongarch.cpp | Implements LSX-vectorized SELU forward. |
| src/layer/loongarch/gelu_loongarch.h | Declares GELU_loongarch layer specialization. |
| src/layer/loongarch/gelu_loongarch.cpp | Implements LSX-vectorized GELU (fast and non-fast) forward. |
| src/layer/loongarch/erf_loongarch.h | Declares Erf_loongarch layer specialization. |
| src/layer/loongarch/erf_loongarch.cpp | Implements LSX-vectorized erf forward. |
| src/layer/loongarch/elu_loongarch.h | Declares ELU_loongarch layer specialization. |
| src/layer/loongarch/elu_loongarch.cpp | Implements LASX/LSX-vectorized ELU forward. |
| src/layer/loongarch/lsx_mathfun.h | Adds erf_ps and elu_ps LSX vector helpers. |
| src/layer/loongarch/lasx_mathfun.h | Adds elu_ps LASX vector helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2. avoid exp overflow
|
superseded by #6662 |
No description provided.